import { requestClient } from '#/api/request';

export function SaveOrUpdate(obj: any) {
  return obj.id ? UpdateObj(obj) : AddObj(obj);
}

export function AddObj(obj: any) {
  return requestClient.request('/iam/opt_logs', {
    method: 'post',
    data: obj,
  });
}

export function DelObj(id: any) {
  return requestClient.request(`/iam/opt_logs/${id}`, {
    method: 'delete',
    data: { id },
  });
}

export function UpdateObj(obj: any) {
  return requestClient.request(`/iam/opt_logs/${obj.id}`, {
    method: 'put',
    data: obj,
  });
}
export function GetPage(query: any) {
  return requestClient.post(`/iam/opt_logs/page`, {
    page: { current: query.current, size: query.size },
    model: {
      nickName: query?.createdName,
    },
  });
}
